AREXX - The REXX language for the Amiga Copyright May, 1988 by Jim Crotinger AREXX, written by Bill Hawes of ConMan fame, is the Amiga implementation of the REXX language. Since most people don't seem to know what AREXX is, though many have heard of it, I thought I'd piece together a little summary. Most of this is paraphrased from the "AREXX Users Reference Manual" (which comes with the package) and "The REXX Language; A Practical Approach to Programming" by M. F. Cowlishaw. I. Specific features of the language: REXX is typeless - In REXX, all variables are considered to be character strings. Nothing has to be declared - variables are dynamically allocated and deallocated as needed. Operations check to see that the operands have valid values. The language includes a rich set of operators for string concatenation, arithmetic, string and numeric comparison, and logical operations. Full set of control statements - REXX has several flavors of DO ( do i = 1 to 10; do while; do until; ...), a SELECT statement (similar to C's SWITCH), compound IF/ELSE, and a SIGNAL statement to trap errors. There is *no* GOTO statement, but BREAK, ITERATE, and LEAVE provide limited forms of GOTO. Callable functions - There are several types of functions: Built-in functions - functions which are defined as part of a specific implementation of the language. Internal routines - REXX "subroutines" located within a program External routines - external REXX "subroutines" External functions - the language may be effectively extended by writing function libraries, which are implemented as Amiga shared libraries. Interprocess communication, hosts, and commands - REXX provides an EASY-TO-USE mechanism to communicate with other programs. If an application program, e.g. a terminal emulator, initializes the proper interface, it can become a REXX "host". REXX hosts can accept "commands" and pass "results" back to any REXX program. Thus REXX programs can be used to control other programs and/or to integrate a number of different applications. This is a VERY powerful capability in a multitasking environment! Interpreted execution, source level debugging and tracing - These features greatly ease the task of program development. Some of the functions available as part of the AREXX environment - I/O functions: The REXX language has PULL and SAY commands to read from STDIN and write to STDOUT. In addition, the function libraries include the commands OPEN(), CLOSE(), EXISTS(), READCH(), WRITECH(), READLN(), WRITELN(), EOF(), and SEEK() for working with data files. Interprocess communication: REXX programs can act as hosts via the support library functions OPENPORT(), CLOSEPORT(), WAITPKT(), GETPKT(), and GETARG(). Other "Builtin" functions - AREXX includes a wide variety of other builtin functions for string parsing and manipulation, bit manipulation, memory allocation and Other function libraries - Willy Langeveld has written three: rexxarplib.library gives limited use of arp.library; rexxmathlib.library adds IEEE transcendental function support; rexxmathsbii.library adds 68881 support for those with a Starboard II 68881 chip. II. The abilities of AREXX make it suitable for: General purpose programming and programming education - modern and powerful language, but with a simple syntax and typeless data Tailoring User commands - with a suitable shell (see WSHell writeup) AREXX can serve as a very powerful shell script language Macros ("execs")- For applications that support AREXX, it serves as a general purpose macro language. Prototype development - The highly interactive, interpreted environment provided by AREXX make it a very productive system for modelling applications software during development. III. Programs which currently support AREXX are: VLT - the VT100/Tektronix terminal emulator by Willy Langeveld. TxEd+ - text editor by Charlie Heath (Microsmiths Software). AmigaTeX - Amiga implementation of TeX by Tom Rokicki (Radical Eye Software). Cape Macro Assembler - This is an integrated assembler development system. MicroFiche Filer - a graphics oriented database. There is also an AREXX version of micrognuemacs as well as SpeechToy. (Source code is available for these if one wants examples of how to add the proper AREXX interface) IV. Examples: I have macros that integrate my editor (TxEd+), AmigaTeX, and VLT into a very nice system. For example, from within my editor a can send the current file to AmigaTeX, to be TeX'ed and previewed. In about 3 seconds I can be looking at the first page on the previewer. Or I can mark some text (usually a complicated equation) and send it to tex. This feature is very nice for "debugging" equations in long documents. If TeX encounters an error, I can select a menu item in the editor and a macro talks to AmigaTeX, finds out where the error occured, and positions my cursor at the appropriate place. When I'm satisfied with the file, I can select another item and have a macro send the file to the VAX (via VLT) and print it on the laser printer. I have another set of macros for referencing the C include files while programming. If I want information about a data structure, I position the cursor on the structure name and run the reference macro. It checks a reference table to see if the selected text has an entry, and if so, where to find the entry. If it finds one it extracts the entry from the appropriate file and loads it into a second editor window. V. Conclusion I think AREXX has a lot to offer the Amiga. If you want to find out more about REXX, there are a couple of books. The one by Cowlishaw mentioned above and "Modern Programming Using REXX" by O'Hara and Gomberg. I think there have also been some recent articles on REXX in Byte and one of the PeeCee magazines. Bill Hawes also has an artical in "The Amigan - Apprentice & Journeyman", V2N3 p.262. Don't spend too much money doing research though - the AREXX package is only $49.95 and includes an excellent manual (155 pages, TeX'ed, with a good table of contents and index). For information, check your local dealer or contact: William S. Hawes P.O. Box 308 Maynard, MA 01754 (617) 568-8695